//
//  LTCOneViewController.swift
//  UIKitCatalog
//
//  Created by LiJonius on 16/1/25.
//  Copyright © 2016年 Apple. All rights reserved.
//

import UIKit

class LTCOneViewController: UIViewController ,TwoViewControlDelegate {
    var button : UIButton!
    override func viewDidLoad() {
        super.viewDidLoad()
        configerButton()
        // Do any additional setup after loading the view.
    }
    func configerButton(){
        
        self.button=UIButton(type: .Custom)
        self.button.frame=CGRectMake(50, 80, 60, 32)
        self.button.backgroundColor=UIColor.cyanColor()
        self.button.addTarget(self, action: "clickBtn", forControlEvents: UIControlEvents.TouchUpInside)
        self.view.addSubview(self.button)
    }
    func clickBtn(){
        let viewcontroller=LTCTwoViewController()
        viewcontroller.delegate=self
        self.presentViewController(viewcontroller, animated: true) { () -> Void in}
    }
    // ----    TwoViewControlDelegate 实现协议的方法
    func changeLabel(name: String, age: String) {
        NSLog("\(name+age)");
    }
    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
        // Get the new view controller using segue.destinationViewController.
        // Pass the selected object to the new view controller.
    }
    */

}
